package cn.mymall.entity;

import cn.mymall.constant.StatusConstant;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.StringUtils;

import java.time.LocalDateTime;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author liqilun
 * @since 2022-10-22
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class Member extends Model {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 手机号
     */
    private String mobile;

    /**
     * 用户昵称
     */
    private String nickname;

    /**
     * 用户头像url地址
     */
    private String headpic;

    /**
     * 状态，Y:可用，N:停用， H:黄牛拉黑
     */
    private String status;

    /**
     * 注册时间
     */
    private LocalDateTime addTime;

    /**
     * 最后修改时间
     */
    private LocalDateTime modifyTime;

    public boolean isValid(){
        return StringUtils.equals(status, StatusConstant.Y);
    }
}
